﻿@{
    ViewBag.Title = "档案初始化";
    Layout = "~/Views/Shared/_LayoutForBUI.cshtml";
}
<body class="navbar-bottom">
    <!-- Page container -->
    <div class="page-container">
        <!-- Page content -->
        <div class="page-content">
            <div class="sidebar sidebar-secondary sidebar-default" style="width:150px">
                <div class="sidebar-content">
                    @{
                    if (ViewBag.ArchiveTree != null)
                    {
                        var trees = ViewBag.ArchiveTree as List<SGArchiveSystem7x.Models.CArchiveTreeModel>;
                        foreach (var m in trees)
                        {
                            <div class="sidebar-category">
                                <div class="category-title">
                                    <span>@m.archieType.ATYPE_NAME</span>
                                    <ul class="icons-list">
                                        <li><a href="javascript:void(0)" data-action="collapse"></a></li>
                                    </ul>
                                </div>

                                <div class="category-content no-padding">
                                    <ul class="navigation navigation-alt navigation-accordion">
                                        @{
                                        foreach (var cm in m.archiveTree)
                                        {
                                            <li><a href="javascript:void(0)" onclick="ToArchive('@cm.AR_ID','@cm.AR_NAME', '@m.archieType.ATYPE_NAME')"><i class="icon-compose"></i>@cm.AR_NAME</a></li>
                                    }
                                        }
                                    </ul>
                                </div>

                            </div>
                    }
                }
                    }
                </div>
            </div>
            <div class="content-wrapper">
                <div style="margin-top:0px;margin-left:5px;margin-right:5px">
                    <iframe id="ArchiveInit_index_frmMain" src="" frameborder="0" scrolling="no" width="100%"></iframe>
                </div>
            </div>
        </div>
    </div>
    <!-- /page container -->
    <script>
        var height = document.documentElement.clientHeight; //window.screen.height-280;
        var width = document.documentElement.clientWidth; //window.screen.width;
        var leftW = 300;
        if (width > 1200) {
            leftW = 500;
        } else if (width > 1000) {
            leftW = 350;
        } else {
            leftW = 100;
        }
        $('#ArchiveInit_index_frmMain').height(height);

        function ToArchive(arid, arname, typename) {
            var name='@ViewBag.Name';
            //if (name=="档案维护")
            //    document.getElementById('ArchiveInit_index_frmMain').src = "/ArchiveWH/Index?aid=" + arid;
            //else if (name== "档案利用")
            //    document.getElementById('ArchiveInit_index_frmMain').src = "/ArchiveUse/Index?aid=" + arid;
            // else
            document.getElementById('ArchiveInit_index_frmMain').src = "/ArchiveInit/ArchiveAJ?type=" + name + "&arid=" + arid + '&sn=' + arname;
        }
    </script>
</body>
